#!/usr/bin/python
# coding=utf-8
from flask import Flask, request
from flask_restplus import Api, Resource, fields, reqparse
from flask_restplus._http import HTTPStatus


#
# @p_namespace.route('/student.sdo')
class Student(Resource):
    """

    Shows a list of all todos, and lets you POST to add new tasks
    """

    def __init__(self, api=None, *args, **kwargs):
        """

        """
        super().__init__(api, *args, **kwargs)

        parser = reqparse.RequestParser()
        # 参数模型
        # parser.add_argument('id', type=str, required=True, help="id")
        # parser.add_argument('name', type=str, required=True, help="名称")
        # parser.add_argument('volume', type=int, required=True, help="方量")
        self.params = parser.parse_args()

        self.my_bar = kwargs['my_bar']

    # @p_namespace.doc('add new stuent  我是DO， 我顶你个肺')
    # @p_namespace.expect(model_student)
    # @p_namespace.marshal_with(model_student, code=HTTPStatus.OK, description="000")
    def post(self):
        """

        添加一个学生
        """
        print(request.headers)

        response = "{'message':'success'}"
        status_code = 200
        return response, status_code
